<template>
  <div>
    <el-card class="box-card">
      <h2>合同会签意见 - {{ contractName }}</h2>
      <el-table :data="opinions" style="width: 100%">
        <el-table-column prop="opinionId" label="意见ID" width="180"></el-table-column>
        <el-table-column prop="author" label="作者"></el-table-column>
        <el-table-column prop="opinion" label="意见"></el-table-column>
      </el-table>
    </el-card>
  </div>
</template>

<script>
export default {
  data() {
    return {
      contractName: '',
      opinions: []
    };
  },
  created() {
    this.contractName = this.$route.params.contractName;
    this.fetchOpinions();
  },
  methods: {
    fetchOpinions() {
      this.axios.get(`/api/contract/${this.contractName}/opinions`)
        .then(response => {
          this.opinions = response.data;
        })
        .catch(error => {
          console.error('获取会签意见出错:', error);
        });
    }
  }
}
</script>

<style scoped>
.box-card {
  margin: auto;
  width: 800px;
}
</style>
